package great.easychat.help.dialog.gravity

import androidx.lifecycle.LifecycleOwner
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import androidx.fragment.app.DialogFragment
import android.view.*
import com.qizhou.base.dialog.lifecycledialog.applyGravityStyle


/**
 * Created by mjl on 18-6-27.
 */
class HeightFullScreenDialogGravityHandler(dialogFragment: DialogFragment)
    : BaseDialogGravityHandler(dialogFragment) {

    init {
        //animationStyleresId = R.style.dialogAnimAlpha
    }

    override fun applyGravity(window: Window) {
        window.applyGravityStyle(Gravity.TOP, animationStyleresId, ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT)
    }

    override fun onCreate(owner: LifecycleOwner) {
       // mDialogFragment.setStyle(DialogFragment.STYLE_NO_FRAME, R.style.TransparentBase)
    }


    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        //用来全屏显示，并且不隐藏状态栏
//        mDialogFragment.dialog.window.requestFeature(Window.FEATURE_NO_TITLE)
          mDialogFragment.dialog!!.window!!.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
        return null
    }

}